package com.xry.healthy.controller;

import com.xry.common.core.domain.R;
import com.xry.healthy.service.RestorativesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**常见药品
 * @Author：ypc
 * @Date：2023/9/30
 * @Description：
 */
@RestController
@RequestMapping("/restoratives")
public class RestorativesController {
    @Autowired
    private RestorativesService restorativesService;

    @GetMapping("/restoratives-list")//所有药品类型
    public R administrative(){
        return restorativesService.restoratives();
    }

    @GetMapping("/medicine-list/{id}")//根据药品类型找对应所有药
    public R medicine(@PathVariable Long id){
        return restorativesService.medicine(id);
    }

    @GetMapping("/medicine-info/{id}")//根据药ID查询对应的药品信息
    public R medicineInfo(@PathVariable Long id){
        return restorativesService.medicineInfo(id);
    }






}
